package com.example.exchangeapp.zjs;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

public class GetUserStatus {
    private Context context;
    private MySQLiteOpenHelper mySQLiteHelper;

    public GetUserStatus(Context context) {
        this.context = context;
        mySQLiteHelper = new MySQLiteOpenHelper(context);
    }

    public Cursor getDataFromDatabase() {
        //获取可读数据库
        SQLiteDatabase db = mySQLiteHelper.getReadableDatabase();
        Cursor cursor = db.query(
                "Users",   // 表明
                null,             // 要查询的列数据
                null,              // 条件语句
                null,          // 条件语句的值
                null,
                null,
                null               // 排序语句
        );
        System.out.println("数据库数据为"+cursor.getCount());
        return cursor;
    }
}
